<template>
	<view>
		<!-- 重绘导航栏 -->
		<u-navbar :is-back="true" title="执业机构" :background="background" :border-bottom="false"></u-navbar>

		<view class="bgf3f5f7" style="height: 100vh;">
			<view class="bgFFFFFF u-p-l-26 u-p-r-26">
				<city-select v-model="value" @city-change="cityChange"></city-select>
				<u-cell-item title="机构名称" :arrow="false">
					<input type="text" placeholder="填写" placeholder-style="text-align: right;font-size: 24rpx;"
						v-model="value1" style="" />
				</u-cell-item>
				<view style="border-bottom:1px solid #f9f8f9 ;line-height: 80rpx;" @click="value = true">
					选择地区
					<text class="text">{{input}}</text>
				</view>
				<u-cell-item title="详细地址" :arrow="false">
					<input type="text" placeholder="填写" placeholder-style="text-align: right;font-size: 24rpx;"
						v-model="value2" style="" />
				</u-cell-item>
			</view>
		</view>
		<u-button type="primary" style="width: 90%;position: fixed;bottom: 60rpx;left: 5%;" @click="endClick()">确定
		</u-button>
	</view>
</template>

<script>
	import citySelect from '@/components/citySelect/u-city-select.vue';
	export default {
		components: {
			citySelect
		},
		data() {
			return {
				height: 30,
				bgColor: this.$u.color.bgColor,
				marginTop: 30,
				marginBottom: 30,
				value: false,
				input: '省、市、区',

				value1: '',
				value2: '',
				type: 'text',
				border: false,
				background: {
					backgroundColor: '#00a8ff',
				}
			}
		},

		onLoad() {
		},
		methods: {
			onPageScroll(e) {
				this.scrollTop = e.scrollTop;
			},
			cityChange(e) {
				this.input = e.province.label + '-' + e.city.label + '-' + e.area.label;
				console.log(this.input);
			},
			swithCheck(index) {
				let x = 1;
				for (let i = 0; i < this.listProject.length; i++) {
					if (this.listProject[i].check == true) {
						x += 1;
					}
				}
				if (x > 3) {
					console.log("大于3个");
					if (this.listProject[index].check = true) {
						this.listProject[index].check = !this.listProject[index].check;
					}
				} else if (x < 4) {
					this.listProject[index].check = !this.listProject[index].check;
				}
			},
			selectCity() {

			},
			// 确定事件
			endClick() {
				console.log("点击了确认,返回上一级")
				console.log("机构名称：" + this.value1);
				console.log("选择地区：" + this.input);
				console.log("详细地址：" + this.value2);
				// 机构名称 选择地区 详细地址
				uni.setStorageSync('value1', this.value1)
				uni.setStorageSync('input', this.input)
				uni.setStorageSync('value2', this.value2)
				uni.navigateBack({
					url: '/pages/qualification/qualification1/qualification1?value1=' + this.value1 + '&input=' +
						this.input + '&value2=' + this.value2
				})
			}

		}
	}
</script>

<style scoped lang="scss">
	.text {
		font-size: 22rpx;
		color: #d9d6d9;
		float: right;
		text-align: right;
	}
</style>
